From 90141ef30554b358ac8da3379ac2822600cb4ea1 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 5 Nov 2020 13:57:41 -0800 Subject: [PATCH] macos: use NSOpenGLContext directly for current tracking We don't need to interact with GdkGLContext here to keep the current context active. --- gdk/macos/gdkmacosglcontext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdk/macos/gdkmacosglcontext.c b/gdk/macos/gdkmacosglcontext.c index df8f66b136..c01ec28937 100644 --- a/gdk/macos/gdkmacosglcontext.c +++ b/gdk/macos/gdkmacosglcontext.c @@ -175,7 +175,7 @@ gdk_macos_gl_context_real_realize (GdkGLContext *context, NSOpenGLPixelFormat *pixelFormat; GdkGLContext *shared; GdkGLContext *shared_data; - GdkGLContext *existing; + NSOpenGLContext *existing; GLint sync_to_framerate = 1; GLint validate = 0; int major, minor; @@ -185,7 +185,7 @@ gdk_macos_gl_context_real_realize (GdkGLContext *context, if (self->gl_context != nil) return TRUE; - existing = gdk_gl_context_get_current (); + existing = [NSOpenGLContext currentContext]; gdk_gl_context_get_required_version (context, &major, &minor); @@ -249,7 +249,7 @@ gdk_macos_gl_context_real_realize (GdkGLContext *context, self->gl_context = g_steal_pointer (&gl_context); if (existing != NULL) - [GDK_MACOS_GL_CONTEXT (existing)->gl_context makeCurrentContext]; + [existing makeCurrentContext]; return TRUE; } -- 2.30.2